package MonthGame.Magic;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        Set<String> set = new HashSet<>();
        for(int i=0;i<n;i++){
            long x = s.nextLong();
            long y = s.nextLong();
            set.add(String.valueOf(x)+" "+String.valueOf(y));
        }
        int ans = set.size();
        System.out.print(((ans-1)+(ans-1)*(ans-2)/2)*2);
    }
}
